#!/usr/bin/perl -w
use strict;
use warnings;
use diagnostics;
use File::Copy;
use feature qw(switch say);
# 
# Program to insert comments
#
sub uncomment($) {
    my ($file) = @_;

    print "Enable File: $file \n";
    open(INFO, "< $file");
    my $TERM = $/;
    undef $/;
    my $lines = <INFO>;
    $/ = $TERM;
    close(INFO);
    my $define = '//#define LOG_NDEBUG 0';
    my $rdefine = '#define LOG_NDEBUG 0';

    $lines =~ s/$define/$rdefine/;
    print "replacing define \n";

    open (OUT, "> $file");
    print OUT $lines;
    close (OUT);
}

foreach (@ARGV) {
    uncomment("$_");
}
1;
